<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>vue组件3</title>
    <script src="../../js/vue3.js"></script>
    <style>
        #app {
            margin: 2rem auto;
            width: 30%;
        }
        
        p {
            font-size: 1.5rem;
            font-weight: bold;
        }
    </style>
</head>

<body>
    <div id="app">
        <text-part1></text-part1>
        <text-part2></text-part2>
    </div>
    <template id="texts1"><h1>局部组件czy</h1></template>
    <template id="texts2"><h1>全局组件czy</h1></template>
    <script>
        let texts = {
            template: "#texts1"
        }
        const v_app = Vue.createApp({
            data() {
                return {}
            },
            components: {
                TextPart1: texts
            }
        });
        v_app.component("text-part2", {
            template: "#texts2"
        })
        v_app.mount("#app");
    </script>
</body>

</html>